/* _____________________________________________________________________________

	Project: The Effects of Independent Local Radio on Tanzanian Public Opinion: Evidence from a Planned Natural Experiment
	Authors: Donald P. Green, Dylan Groves, Constantine Manda, Beatrice Montano, Bardia Rahmani
	
	Purpose: Figure A7 - spillover analysis, no LASSO
	Date: 2022.10
________________________________________________________________________________*/


/* Introduction ________________________________________________________________*/
	
	clear all	
	set more off
	
/* Set Control Directory _______________________________________________________*/

	*global user "X:/Dropbox/Wellspring Tanzania Papers/Wellspring Tanzania - Natural Experiment/pfm_ne_replication"
		

/* INTERESTKNOWLEDGE ___________________________________________________________*/	

			/* define matrix */		

			import excel "${user}/pfm_ne_replication_rawoutput_spillovers.xlsx", sheet(spill_INTERESTKNOWLEDGE) firstrow clear

			destring coef lowb uppb, replace
			
			mkmat coef lowb uppb, mat(INTERESTKNOWLEDGE)
			matrix rownames INTERESTKNOWLEDGE = "Political Interest (0.81)"					///
										"Knows Tanzanian Prime Minister by name (0.65)"			///
										"Knows Tanzanian Vice President by name (0.64)"			///
										"Knows Tanzanian Chief Justice by name (0.23)"				///
										"Knows position held by Donald Trump (0.32)"						///
										"Knows position held by Joe Biden (0.13)"						///
										"Knows position held by Uhuru Kenyatta (0.62)"					///
										"Knows about early marriage court ruling (0.08)"				///
										"Accepts personal protective equipment (0.15)"				///
										"Would encourage daughter to enter politics (0.71)"			///
										"Political participation index (0.52)"

			/* generate coeffplot */
		
			matselrc INTERESTKNOWLEDGE X_INTERESTKNOWLEDGE , row(1/11)

			coefplot 	matrix(X_INTERESTKNOWLEDGE[,1]), ///
														mcolor(black) ///
														ci((X_INTERESTKNOWLEDGE[,2] X_INTERESTKNOWLEDGE[,3] ))  ///
														ciopts(lcolor(black)) ///
														xline(0) ///
														xscale(r(-0.15(0.05)0.2)) ///
														xlab(-0.15(0.05)0.2) 				///
														graphregion(color(white)) ///
														bgcolor(white) xtitle("") ///
														ytitle("")  ///
														coeflabels(, notick labgap(-122))	///
														yscale(noline alt) ///
														graphregion(margin(l=60)) ///
														transform(* = min(max(@,-0.25),0.20)) ///
														legend(off) ///
														headings(	"Political Interest (0.81)" = "{bf:Political Interest}" ///
																	"Knows Tanzanian Prime Minister by name (0.65)" = "{bf:Domestic Political Figures Knowledge}" ///
																	"Knows position held by Donald Trump (0.32)" = "{bf:Foreign Political Figures Knowledge}" ///	
																	"Knows about early marriage court ruling (0.08)" = "{bf:Current Events Knowledge}" ///
																	"Political participation index (0.52)" = "{bf:Political participation}", labgap(-122))  
														
														
					 graph export "${user}/fa7_coefplot_interestknowledge_spill.png", as(png) width(3500) height(1500)  replace


/* GENDER ______________________________________________________________________*/	

			/* define matrix */		

			import excel "${user}/pfm_ne_replication_rawoutput_spillovers.xlsx", sheet(spill_GENDER) firstrow clear

			destring coef lowb uppb, replace
			drop if variable == "ipv_rej_disobey" // excludes ipv_rej_disobey from figure
			
			mkmat coef lowb uppb, mat(GENDER)
			matrix rownames GENDER =  	"Rejects intimate partner violence (0.79)"						///
										"Thinks community rejects intimate partner violence (0.45)"							///
										"Would report intimate partner violence (0.56)"						///
										"Rejects early marriage (0.65)"			///
										"Thinks community rejects early marriage (0.61)" 				///
										"Shares anti-early marriage message (0.38)"				///
										"Rejects forced marriage (0.80)"			///
										"Gender equality attitudes index (0.67)"			///
										"Relationship satisfaction (0.57)"		///
										"Equal decision-making in relationships (0.87)"			///
										"Equal labor in relationships (0.27)"		

			/* generate coeffplot */
		
			matselrc GENDER X_GENDER , row(1/11)
			
			coefplot matrix(X_GENDER[,1]),  ///
											mcolor(black) ///
											ci((X_GENDER[,2] X_GENDER[,3]))  ///
											ciopts(lcolor(black)) ///
											xline(0) xscale(r(-0.15(0.05)0.20)) xlab(-0.15(0.05)0.2) xtitle("") ///
											graphregion(color(white)) ///
											bgcolor(white)  ///
											ytitle("")  yscale(noline alt) ///
											coeflabels(, notick labgap(-122)) ///
											graphregion(margin(l=60)) ///
											headings(	"Rejects intimate partner violence (0.79)" = "{bf:Intimate Partner Violence}" ///
														"Rejects early marriage (0.65)" = "{bf:Early and Forced Marriage}" ///
														"Gender equality attitudes index (0.67)" = "{bf:Gender Equality and Relationships}", labgap(-122))  
											
					 graph export "${user}/fa7_coefplot_gender_spill.png", as(png) width(3500) height(1500)  replace

						
/* VALUES ______________________________________________________________________*/	

			/* define matrix */		

			import excel "${user}/pfm_ne_replication_rawoutput_spillovers.xlsx", sheet(spill_VALUES) firstrow clear

			cap rename A variable
			cap drop if variable == "prej_thermo_out_eth" // excludes prej_thermo_out_eth from figure, uses "prej_out_eth_short" instead
			cap duplicates drop variable
			
			destring coef	lowb uppb, replace
			
			mkmat coef lowb uppb, mat(VALUES)
			matrix rownames VALUES =  	"Low prejudice index (0.53)" 		///
										"Feeling thermometer towards outgroups (0.58)" 	///
										"Rejects violence against children (0.14)" 	///
										"Does not commit violence against children (0.59)" 	///
										"Religiosity (0.12)" 		///
										"Urbanism (0.22)" 

			/* generate coeffplot */
		
			matselrc VALUES X_VALUES , row(1/6)
			
			coefplot matrix(X_VALUES[,1]),  mcolor(black) ///
											ci((X_VALUES[,2] X_VALUES[,3]))  ///
											ciopts(lcolor(black)) ///
											xline(0) xscale(r(-0.15(0.05)0.20)) xlab(-0.15(0.05)0.2) xtitle("") ///
											graphregion(color(white)) ///
											bgcolor(white)  ///
											ytitle("")  yscale(noline alt) ///
											coeflabels(, notick labgap(-122)) ///
											graphregion(margin(l=60)) ///
											headings(	"Low prejudice index (0.53)" = "{bf:Outgroup Tolerance}" ///
														"Rejects violence against children (0.14)" = "{bf:Violence Against Children}" ///
														"Religiosity (0.12)"  = "{bf:Religiosity and Urbanism}" , labgap(-122))  
											
					 graph export "${user}/fa7_coefplot_values_spill.png", as(png) width(3500) height(1500)  replace



						
